package com.lapost.facteur;


import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;

import android.os.Bundle;

import android.webkit.WebChromeClient;
import android.webkit.WebView;


public class MapActivity extends Activity {

	public static final String TAG = MapActivity.class.getSimpleName();
	Context context;
    private WebView   _webView;
    ProgressDialog dialog;


	
    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        context=this;
        this.setContentView(R.layout.map);
        dialog = new ProgressDialog(context);

        
        _webView = (WebView)this.findViewById(R.id.webview);

        _webView.getSettings().setJavaScriptEnabled(true);
        _webView.getSettings().setBuiltInZoomControls(true);
        _webView.getSettings().setSupportZoom(true);
        
        _webView.setBackgroundResource(R.drawable.timbres);
        
        
    	this.dialog.setTitle("La Poste");
        this.dialog.setIcon(R.drawable.icon_mini);
        this.dialog.setMessage("Chargement en cours...");
        this.dialog.setProgressStyle(R.style.CustomDialogTheme);
        this.dialog.setCancelable(true);
        this.dialog.show();

        _webView.setWebChromeClient(new WebChromeClient() {
            public void onProgressChanged(WebView view, int progress) {
                // Activities and WebViews measure progress with different scales.
                // The progress meter will automatically disappear when we reach 100%
               // setProgress(progress * 1000);
            	
            	if(progress>99){
            		
            		dialog.dismiss();
            	}
            }

        });

        // to handle its own URL requests :
        _webView.loadUrl("https://google-developers.appspot.com/maps/documentation/javascript/v2/examples/map-markers");


    }
    
   
    

}
